package com.view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Principal extends javax.swing.JFrame {
	private JTabbedPane jTabbedPane1;
	private JPanel jPanel1;
	private JButton jButton1;
	private JButton jButton3;
	private JTextField jTextField3;
	private JLabel jLabel3;
	private JButton jButton2;
	private JTextField jTextField2;
	private JLabel jLabel2;
	private JTextField jTextField1;
	private JLabel jLabel1;
	private JPanel jPanel3;
	private JPanel jPanel2;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Principal inst = new Principal();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public Principal() {
		super();
		initGUI();
		initMyComponents();
	}
	
	private void initMyComponents() {
		
		jTextField2.setEditable(false);
		jButton2.setEnabled(false);
		
		jTextField3.setEditable(false);
		jButton3.setEnabled(false);
		
		
	}

	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jTabbedPane1 = new JTabbedPane();
				getContentPane().add(jTabbedPane1);
				jTabbedPane1.setBounds(12, 12, 708, 368);
				{
					jPanel1 = new JPanel();
					jTabbedPane1.addTab("Principal", null, jPanel1, null);
					jPanel1.setBounds(412, 64, 288, 245);
					jPanel1.setPreferredSize(new java.awt.Dimension(539, 310));
					jPanel1.setLayout(null);
					{
						jLabel1 = new JLabel();
						jPanel1.add(jLabel1);
						jLabel1.setText("Nome:");
						jLabel1.setBounds(12, 12, 51, 16);
					}
					{
						jTextField1 = new JTextField();
						jPanel1.add(jTextField1);
						jTextField1.setBounds(73, 10, 402, 20);
					}
					{
						jButton1 = new JButton();
						jPanel1.add(jButton1);
						jButton1.setText("Ok");
						jButton1.setBounds(648, 306, 45, 23);
						jButton1.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								
								JOptionPane.showMessageDialog(null, "Seu nome: " + jTextField1.getText());
								
								jTextField2.setEditable(true);
								jButton2.setEnabled(true);
								
								jTabbedPane1.setSelectedIndex(1);
								
								
							}
						});
					}
				}
				{
					jPanel2 = new JPanel();
					jTabbedPane1.addTab("Segundo", null, jPanel2, null);
					jPanel2.setLayout(null);
					{
						jLabel2 = new JLabel();
						jPanel2.add(jLabel2);
						jLabel2.setText("Sobrenome:");
						jLabel2.setBounds(10, 11, 68, 14);
					}
					{
						jTextField2 = new JTextField();
						jPanel2.add(jTextField2);
						jTextField2.setBounds(88, 8, 423, 20);
					}
					{
						jButton2 = new JButton();
						jPanel2.add(jButton2);
						jButton2.setText("Ok");
						jButton2.setBounds(648, 306, 45, 23);
						jButton2.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								
								JOptionPane.showMessageDialog(null, "Sobrenome: " + jTextField2.getText());
								
								jTextField3.setEditable(true);
								jButton3.setEnabled(true);	
								
								jTabbedPane1.setSelectedIndex(2);
								
							}
						});
					}
				}
				{
					jPanel3 = new JPanel();
					jTabbedPane1.addTab("Terceiro", null, jPanel3, null);
					jPanel3.setLayout(null);
					{
						jLabel3 = new JLabel();
						jPanel3.add(jLabel3);
						jLabel3.setText("Idade: ");
						jLabel3.setBounds(10, 11, 61, 14);
					}
					{
						jTextField3 = new JTextField();
						jPanel3.add(jTextField3);
						jTextField3.setBounds(81, 8, 295, 20);
					}
					{
						jButton3 = new JButton();
						jPanel3.add(jButton3);
						jButton3.setText("Ok");
						jButton3.setBounds(648, 306, 45, 23);
						jButton3.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								
								JOptionPane.showMessageDialog(null, "Idade: " + jTextField3.getText());
								
								jTabbedPane1.setSelectedIndex(0);
								
							}
						});
					}
				}
			}
			pack();
			this.setSize(748, 430);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
